/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.prashant.sqlduniya.sqlmanager;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.List;

/**
 *
 * @author prashant
 */
public class TableBean {

    private String label;
    private String catalog;
    private List<Column> columns;
    private transient PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);

    public TableBean(String label,String catalog) {
        this.label = label;
        this.catalog = catalog;
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        String old = this.catalog;
        this.catalog = catalog;
        changeSupport.firePropertyChange("catalog", old, catalog);
    }

    public List<Column> getColumns() {
        return columns;
    }

    public void setColumns(List<Column> columns) {
        this.columns = columns;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        String old = this.label;
        this.label = label;
        changeSupport.firePropertyChange("label", old, label);
    }
    
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(
            PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
}
